import router from './router'
import { useUserStore } from './stores/user'


router.beforeEach(async (to, from, next) => {
    const userStore = useUserStore()
    if (!Object.keys(userStore.userInfo).length) {
        try {
            await userStore.getUserInfo()
            next()
        } catch (e) {

        }
    }
})